// mycomponent/guide-list/guide-list.js
Component({

  /**
   * 组件的属性列表
   */
  properties: {
    list: {
      type: Array,
      value: []
    },
    levels: {
      type: Object,
      value: {}
    }
  },

  /**
   * 组件的初始数据
   */
  data: {
    guideID: 0,
    guideName: ''
  },

  /**
   * 组件的方法列表
   */
  methods: {
    onChange: function(e) {
      const { guideID } = this.data
      const name = this.data.list.find(item => item.id == e.detail).realname
      this.setData({
        guideID: guideID == e.detail ? '': e.detail,
        guideName: guideID == e.detail ? '': name
      })
    }
  }
})